Applies a transformation to the endpoints of this segment.
A new segment with transformed endpoints.
The transformer to apply to the segment endpoints.